package com.woniu.utils;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;

import java.sql.Time;

/**
 * @author Rain
 * @Description :
 * @date 2022/08/26 16:05
 */
@Configuration
public class FilterRegistration {

    @Bean
    public FilterRegistrationBean<TimeFilter> getFilterRegistrationBean(){
        FilterRegistrationBean<TimeFilter> filterReg = new FilterRegistrationBean<>();
        filterReg.setFilter(new TimeFilter());
        filterReg.addUrlPatterns("/*");
        filterReg.setOrder(Ordered.HIGHEST_PRECEDENCE);
        return filterReg;
    }


}
